package cn.restcloud.example.dao;

import java.util.List;

import org.bson.Document;
import cn.restcloud.example.model.UserModel;
import cn.restcloud.framework.core.base.IBaseDao;
import cn.restcloud.framework.core.base.IBasePageBean;


/**
 * Dao接口Demo
 * @author cn.restcloud
 *
 */
public interface IDemoUserDao extends IBaseDao<UserModel> {

	/**
	 * 根据userid获取对像
	 * @param userid
	 * @return
	 * @throws Exception
	 */
	public UserModel getByUserId(String userid)throws Exception;

	/**
	 * 根据keyid关键字段wf_OrUnid的值获取对像
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public UserModel getById(String id)throws Exception;
	
	/**
	 * 列出所有用户列表
	 * @return
	 * @throws Exception
	 */
	public List<UserModel> listAll()throws Exception;
	
	
	/**
	 * 根据对像删除
	 * @param obj
	 * @return
	 * @throws Exception
	 */
	public int delete(UserModel obj) throws Exception;
	
	/**
	 * 根据多个唯一id删除对像，多个ids用逗号分隔
	 * @param ids
	 * @return
	 * @throws Exception
	 */
	public int deleteByIds(String ids) throws Exception;
	
	/**
	 * 保存或更新用户对像
	 * @param obj
	 * @return
	 * @throws Exception
	 */
	public int save(UserModel obj)throws Exception;
	
	/**
	 * 分页列出用户数据
	 * @return
	 * @throws Exception
	 */
	public IBasePageBean<UserModel> listByPage()throws Exception;
	
	/**
	 * 按条件列出用户数据
	 * @return
	 * @throws Exception
	 */
	public IBasePageBean<UserModel> listByPageAndState(String state)throws Exception;
	
	/**
	 * 按条件列出用户数据并可以传入动态过滤条件
	 * @return
	 * @throws Exception
	 */
	public IBasePageBean<UserModel> listByPageAndStateAndFilters(String state)throws Exception;
	
	/**
	 * 完全自定义sql条件进行分页查询
	 * @return
	 * @throws Exception
	 */
	public IBasePageBean<UserModel> listByPageBySqlWhere(String state)throws Exception;
	
	
}
